package com.jx.medical.service.impl;

import com.jx.medical.mapper.UserMapper;
import com.jx.medical.pojo.Buyer;
import com.jx.medical.pojo.User;
import com.jx.medical.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jx
 * @date Created on 2020/12/3  16:08
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public User findUser(User user) {
        User users = userMapper.findUser(user);
        return users;
    }

    @Override
    public int registUser(User user) {
        int i = userMapper.registUser(user);
        return i;
    }

    @Override
    public User getUserByAcc(String acc) {
        User userByAcc = userMapper.getUserByAcc(acc);
        return userByAcc;
    }

    @Override
    public int registBuyer(Buyer buyer) {
        int i = userMapper.registBuyer(buyer);
        return i;
    }

    @Override
    public Buyer getBuyerById(int buyerId) {
        Buyer buyer = userMapper.getBuyerById(buyerId);
        return buyer;
    }

    @Override
    public int deleteUser(String acc) {
        int i = userMapper.deleteUser(acc);
        return i;
    }

    @Override
    public int deleteBuyer(int buyerId) {
        int i = userMapper.deleteBuyer(buyerId);
        return i;
    }

    @Override
    public int updateBuyer(Buyer buyer) {
        int i = userMapper.updateBuyer(buyer);
        return i;
    }


}
